# demo06_poly.py
# 动物
class Animal:
    # 发出声音（规范）
    def make_sound(self):
        pass
# 狗
class Dog(Animal):
    # 多态，重复父类的方法
    def make_sound(self):
        print('汪汪..')
class Cat(Animal):
    def make_sound(self):
        print('喵喵..')
class Bird(Animal):
    def make_sound(self):
        print('叽叽喳喳..')

# d = Dog()
# c = Cat()
# d.make_sound()
# c.make_sound()
# 处理所有动物的声音
animals = [Dog(), Cat(), Bird()]
for item in animals:
    item.make_sound()



